package StudyCode.summary.mycollection;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class GetsAListBasedOnAnIterator {
	public static <T> List<T> toList(Iterator<T> it) {
		List<T> list = new ArrayList<>();
		while (it.hasNext())
			list.add(it.next());
		return list;
	}
}
